package DatabaseInterface;

import HibernateFacet.second.*;

import java.io.DataOutputStream;
import java.util.Date;
import java.util.List;

public interface Ad2Service {
    int addDeviceData(String addr ,DataOutputStream out,byte[] data);
    int addDevice(String addr,DataOutputStream out,byte[] data);
    int updateCondition(String addr,DataOutputStream out,byte[] data); //修改分闸状态
    int updateCurrentRating(String addr,Integer current); //修改额定电流
    List<String> findUserDeviceNumber(Integer userId);
    int checkDevicePWd(String number,String pwd);
    int updateDevicePWd(String id,String pwd);
    int findUserDeviceNum(int userId);
    int findUserDeviceSumPower(int userId);
    List<ElectricityData> findUserDeviceUseElectricityByYear(int userId, String d1, String  d2);
    ElectricityData findUserDeviceUseElectricity(int userId, String d1, String  d2);
    ElectricityData findDeviceUseElectricity(int deviceId, String d1, String  d2);
    Integer findFaultNum(int userId);
    Integer clearedSumPower(String number);

    Warning findOneWarning(int userId);
    Warning findDeviceWarning(int deviceId);
    List<Warning> findUserWarning(int userId,String d1,String d2);
    List<Warning> findDeviceWarnings(int deviceId,String d1,String d2);

    List<Device> findDeviceByUserId(int userId);
    Device findDeviceInfoById(int id);
    DeviceData findDeviceData(int deviceId);

    int addDevice(Integer userId,String number);
    int registered(String name,String pwd,String phone);
    User login(String name,String pwd);
    String findUserPhoneByName(String name);
    int updateUserPwd(String name,String pwd);
}
